package view;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import modelImp.Player;

public class ActifPlayerPanel extends JPanel{
	
	private static final long serialVersionUID = 1L;
	private JLabel playerLabel;
	private JLabel scoreLabel;
	private Player player;
	String scoreTexte = "0 point(s)";
	public ActifPlayerPanel(){}
	
	public ActifPlayerPanel(String path,Player player){
		this.setPlayer(player);
		this.setLayout(new RowLayout());
		Icon icon = new ImageIcon(path);
		playerLabel = new JLabel(player.getName(), icon, JLabel.CENTER);
		this.add(playerLabel);
		playerLabel.setPreferredSize(new Dimension(800,37));
		playerLabel.setBackground(Color.white);
		scoreLabel = new JLabel(scoreTexte,JLabel.CENTER);
		this.add(scoreLabel);
		this.setBorder(BorderFactory.createLineBorder (Color.GRAY, 1));
		this.setBackground(Color.white);
	}

	public void setPlayer(Player player) {
		this.player = player;
	}

	public Player getPlayer() {
		return player;
	}
}